package com.itheima.mapper;

import com.itheima.pojo.OrderSetting;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.time.LocalDate;

@Mapper
public interface OrderSetTingMapper {
    /**
     * 根据预约日期查询预约设置数据
     * @param orderDate
     * @return
     */
    @Select("select * from ordersetting where order_date = #{orderDate}")
    OrderSetting getOrderSettingByOrderDate(LocalDate orderDate);


    void update(OrderSetting orderSetting);

    /**
     * 根据预约日期修改可预约人数
     * @param reservations
     */
    @Update("update ordersetting set reservations = #{reservations} where order_date = #{orderDate}")
    void updateByReservations(int reservations, LocalDate orderDate);
}
